﻿MainForm = Class.create();

MainForm.prototype = Object.extend(new Common(), {
    initialize: function () {
        this.initCommonProperty();

        //定义head导航对象
        this.headIns = null;

        //定义sub_menu导航对象
        this.menuIns = null;

        //定义sub_menu导航对象
        this.cmnTabIns = null;
    },

    init: function () {
        var mainFormIns = this;

        Event.observe($("menu_hidden"), 'click', this.onClick_menu_hidden.bind(this));

        $j("#mainForm_bottom_div").css("height", parseInt($j("#mainForm_body").css("height"), 10) - 110 + "px");
        this.cmnTabIns.setCmnTabBodyHeight(parseInt($j("#mainForm_bottom_div").css("height"), 10) - 45);

        $j(window).resize(function () {
            $j("#mainForm_bottom_div").css("height", parseInt($j("#mainForm_body").css("height"), 10) - 110 + "px");
            mainFormIns.cmnTabIns.setCmnTabBodyHeight(parseInt($j("#mainForm_bottom_div").css("height"), 10) - 45);
        });

    },

    onClick_menu_hidden: function () {
        if ($j("#div_menu").css("display") == "none") {

            $j("#td_menu").stop().animate({
                width: "200px"
            }, 300, function () {
                $j("#div_menu").show();
                $j("#menu_hidden").html("<img src='../../Content/images/btn_left.png' />");
            });

        }
        else {
            $j("#div_menu").hide();
            $j("#td_menu").stop().animate({
                width: "10px"
            }, 300);
            $j("#menu_hidden").html("<img src='../../Content/images/btn_right.png' />");
        }
    }
});
